package com.cn.ccp.bean;

import java.util.ArrayList;
import java.util.List;

public class CourseContentManageBean {
	
	private String chapter_number ;
	//章节标题
	private String title1 ;
	private String title2 ;
	private String title3 ;
	//章节信息
	private List<CourseContentBean> ccList = new ArrayList<CourseContentBean>();//章节下面有课程内容
	//小节信息
	private List<CourseContentBean> ccmList = new ArrayList<CourseContentBean>();//小节下面的课程内容
	
	private String xtitle1 ;
	private String xtitle2 ;
	
	
	private List<CourseContentManageBean> xjMList = new ArrayList<CourseContentManageBean>();
	
	
	public String getTitle1() {
		return title1;
	}
	public void setTitle1(String id ,String title1 ,int index, String chapter_number,boolean showDelete) {
		String s = "<div class=\"accordion-group\">"+
	                  "<div class=\"accordion-heading\">"+
	                    "<a class=\"accordion-toggle\" data-toggle=\"collapse\" data-parent=\"#accordion1\" href=\"#collapse"+index+"\">"+
	                      "<i class=\"icon-resize-vertical\"></i>"+title1+
	                    "</a>" ;
	   if(showDelete)                   
	                   s += "<a class='icon-trash' style='position:relative;top:-25px'  onclick=\"if(!confirm('确定需要删除该章节所有内容？')){return false;}\" href=\"pages/course/editCourse/editCourse.faces?zjId="+id+"\"></a>";
		this.title1 = s;
	}
	
	public void setTitle1(String id ,String canBrowse ,String title1 ,int index, String chapter_number,boolean showDelete) {
		if("1".equalsIgnoreCase(canBrowse.trim()))
			 setTitle1(id ,title1, index, chapter_number,showDelete);
		else{
				
			String s = "<div class=\"accordion-group\">"+
		                    "<div class=\"accordion-heading\">"+
		                    "<i class=\"icon-resize-vertical\"></i>"+title1+
		                    "&nbsp;&nbsp;&nbsp;&nbsp;";
			if(showDelete)
				s += "<a onclick=\"if(!confirm('确定需要删除该章节所有内容？')){return false;}\" class='icon-trash' href=\"pages/course/editCourse/editCourse.faces?zjId="+id+"\"></a>";
			
			this.title1 = s;
		}
	}
	
	
	public String getTitle2() {
//		if(ccList.size() == 0)
//			title2 = "</div>";
		return title2;
	}
	public void setTitle2(int index) {
		String s = " </div>"+
                      "<div id=\"collapse"+index+"\" class=\"accordion-body collapse in\">"+
                        "<div class=\"accordion-inner\">"+
                            "<ol>";
		this.title2 = s;
	}
	public String getTitle3() {
		String s ="</ol>"+
			        "</div>"+
			      "</div>"+
			    "</div>";
//		if(ccList.size() == 0)
//			s = "</div>";
		return s ;
	}
	public void setTitle3(String title3) {
		String s = "</ol>"+
	                    "</div>"+
	                  "</div>"+
	                "</div>";
		this.title3 = s;
	}
	public String getChapter_number() {
		return chapter_number;
	}
	public void setChapter_number(String chapter_number) {
		this.chapter_number = chapter_number;
	}
	public List<CourseContentBean> getCcList() {
		return ccList;
	}
	public void setCcList(List<CourseContentBean> ccList) {
		this.ccList = ccList;
	}
	public List<CourseContentBean> getCcmList() {
		return ccmList;
	}
	public void setCcmList(List<CourseContentBean> ccmList) {
		this.ccmList = ccmList;
	}
	public void setTitle1(String title1) {
		this.title1 = title1;
	}
	public void setTitle2(String title2) {
		this.title2 = title2;
	}
	public String getXtitle1() {
		return xtitle1;
	}
	public void setXtitle1(String xtitle1) {
		this.xtitle1 = xtitle1;
	}
	
	public void setXtitle(String id , String title ,String chapterNumber,boolean showDelete){
		String s = "<a class='accordion-toggle' data-toggle='collapse' data-parent='#collapseOne' href='#collapse"+id+"'>"+
				   		title+
				   "</a>"+
				   "&nbsp;&nbsp;&nbsp;&nbsp;";
	 if(showDelete)
		  s += "<a class='icon-trash' onclick=\"if(!confirm('确定需要删除该小节所有内容？')){return false;}\"  href=\"pages/course/editCourse/editCourse.faces?xjId="+id+"\"></a>";
				  
	 s +=  "<div id='collapse"+id+"' class='accordion-body'>"+
				   "<ol class='unstyled'>";
		
		xtitle1 = s ;
	}
	
	public String getXtitle2() {
		String s = "</ol>"+
		 		"</div>"+
		   "</li>";
		return s;
	}
	public void setXtitle2(String xtitle2) {
		String s = "</ol>"+
		 		"</div>"+
		   "</li>";
		this.xtitle2 = s;
	}
	public List<CourseContentManageBean> getXjMList() {
		return xjMList;
	}
	public void setXjMList(List<CourseContentManageBean> xjMList) {
		this.xjMList = xjMList;
	}
	
}
